sizegroup: Use g_hash_table_add()
authorEmmanuele Bassi <ebassi@gnome.org>
Sun, 25 Nov 2012 21:57:41 +0000 (22:57 +0100)
committerBenjamin Otte <otte@redhat.com>
Sun, 25 Nov 2012 21:58:19 +0000 (22:58 +0100)
This is the function to use when treating hash tables as a set.

gtk/gtksizegroup.c

index a9ae863174c3ac9bf33673552545af6c350697e6..e31dfa84eb1755b30b53f228eeff280941a16989 100644 (file)
@@ -163,7 +163,7 @@ add_widget_to_closure (GHashTable     *widgets,
   if (g_hash_table_lookup (widgets, widget))
     return;
 
-  g_hash_table_insert (widgets, widget, widget);
+  g_hash_table_add (widgets, widget);
   hidden = !gtk_widget_is_visible (widget);
 
   for (tmp_groups = _gtk_widget_get_sizegroups (widget); tmp_groups; tmp_groups = tmp_groups->next)
@@ -180,7 +180,7 @@ add_widget_to_closure (GHashTable     *widgets,
       if (!(tmp_priv->mode & (1 << orientation)))
         continue;
 
-      g_hash_table_insert (groups, tmp_group, tmp_group);
+      g_hash_table_add (groups, tmp_group);
 
       for (tmp_widgets = tmp_priv->widgets; tmp_widgets; tmp_widgets = tmp_widgets->next)
         add_widget_to_closure (widgets, groups, tmp_widgets->data, orientation);